﻿using DynamicViewFormLibrary.Utils;
using WordOpenXmlClassLibrary;
using WordOpenXmlClassLibrary.Entity;
using WordOpenXmlClassLibrary.Enum;

namespace DynamicViewFormLibrary
{
    public class RtfGenerater
    {
        /// <summary>
        /// 创建选择题RTF文件
        /// </summary>
        /// <param name="itemChoices"></param>
        /// <param name="itemOrientation"></param>
        /// <param name="itemNum"></param>
        /// <param name="itemStart"></param>
        /// <returns>RTF文件路径</returns>
        public static string GeneraterObjectItem(string itemChoices, int itemOrientation, int itemNum, int itemStart)
        {
            string filePath = FilePathUtil.DocumentFilePath();


            BlockOption blockOption = new BlockOption(itemChoices, itemNum, itemStart, itemOrientation);


            GenerateManager generater = new GenerateManager();
            generater.FilePath = filePath;
            generater.CreateObjectiveItem(blockOption);

            string rtfPath = SpireDocManager.WordToRTF(filePath);
            return rtfPath;
        }
    }
}
